/*
 * @Author: your name
 * @Date: 2022-01-16 16:26:44
 * @LastEditTime: 2022-01-16 16:35:14
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /type-script-exercise/demo8.ts
 */
class Person {
  name = 'dell'
  getName() {
    return this.name
  }
}

const person = new Person()
console.log(person.getName())

class Teacher extends Person {
  getTeacherName() {
    return 'teacher'
  }
  getName() {
    return super.getName() + 'Lee' // 把父类方法重写之后，还想调用负累的方法，就用super
  }
}

const teacher = new Teacher()

console.log(teacher.getTeacherName())
